﻿
namespace GlobalStore.Core
{
    public interface IStorageProvider
    {
        void Upload(byte[] bytes);
        byte[] Download();
    }

    /* Write Store provider for each storage possibility
     * 
     * - Need a Central DB where store the redundant peace locations, and the storage type
     * - Need a Dir and a Search functionality.
     * - Need an encription/decription it can be also randomly choesed
     * - Need Compression
     * - Split strategy/ újraegyesítés strategy (Peaces size, order)
     * 
     */

    /* DataStructure in DB
     * 
     * Directories (Id, Name, creationDate, owner, [ParentDirectory], { Files }, { Directories })     // Right handling List/Read/Write/Delete
     * Files (Id, Name, creationDate, size, owner, [Directory], { Peieces })      // Right handling List/Read/Write/Delete
     * Pieces (Id, creationDate, size, encriptionType, [File], { Locations })
     * Location (Id, StorageType, [Connection], [Peace])
     * Connection (Id, addr, user, pwd, port, path, other, [Location])
     * 
     * Users (Name, pwd, ...)
     * RightAssociation (Direcory Or File, Rights)
     * 
     */

    /* Work flow
     * 
     * Create directory, or subDirectory (Just an Entry in the Db)
     * 
     * I have a file -> I want to upload it
     * (encrypt?) -> split(crc, md5) -> (encript?) == peaces        //First encript and than split or split and than encript. (Both???)
     * Upload the first copy -> upload the shaddow copies (0 - N)   //The shaddow copy number depens on ??? importance, lifetime, static ?
     * 
     * List -> Search -> Download
     * Return the list of the pieces, start download, CRC, MD5 check -> egyesítés -> decrypt
     * 
     */
}